package fem2.jlinalg;

import inf.jlinalg.IMatrix;
import inf.jlinalg.SolveFailedException;
import fem2.Echoer;

public abstract class Solver extends Echoer {

	/**
	 * @return the right hand side matrix associated with the solver
	 */
	public abstract IMatrix getA();

	/**
	 * set the dimension of right hand side matrix
	 * 
	 * @param dimk
	 */
	public abstract void setSize(int dimk);

	/**
	 * set the internal structure of right hand side matrix by symbolic table
	 * 
	 * @param t
	 */
	public abstract void setSize(SymbolicTable t);

	/**
	 * must be invoked before calling solve routine
	 */
	public abstract void initialize();

	/**
	 * take b as right hand side and return b as solution
	 * 
	 * @param b
	 * @throws SolveFailedException
	 */
	public abstract void solve(double[] b) throws SolveFailedException;

	/**
	 * finalize the solver, release resources
	 */
	public abstract void finalize();

}
